﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CookComputing.XmlRpc;

namespace wiki2doc
{

    public struct UTC_Timestamp
    {
        public int year;
        public int month;
        public int day;

        public int hour;
        public int minute;
        public int second;
    }

    [XmlRpcMissingMapping(MappingAction.Ignore)]
    public struct PageItem
    {
        public string id;
        public int perms;
        public int size;
        public UTC_Timestamp lastModified;
    }

    public struct GetPageListOptions
    {
        public int depth;
        public bool hash;
        public bool skipacl;
    }

    public struct PageLink
    {
        public string type;
        public string page;
        public string href;
    }

    public interface IDokuWiki : IXmlRpcProxy
    {

        [XmlRpcMethod("dokuwiki.getVersion")]
        string getVersion();

        [XmlRpcMethod("dokuwiki.getPagelist")]
        PageItem[] getPageList(string nmspace, GetPageListOptions options);

        [XmlRpcMethod("wiki.getPage")]
        string getPage(string pagename);

        [XmlRpcMethod("wiki.getPageHTML")]
        string getPageHTML(string pagename);

        [XmlRpcMethod("wiki.listLinks")]
        PageLink[] listLinks(string pagename);

        [XmlRpcMethod("wiki.getAttachment")]
        byte[] getAttachment(string id);
    }
}

